package com.mysql.injector.config;

import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import com.mysql.injector.injectror.MySqlInjector;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
// @AutoConfiguration
@ConditionalOnClass(MybatisPlusAutoConfiguration.class)
@ConditionalOnProperty(prefix = "mysqlInjector", name = "enabled", matchIfMissing = true)
public class MybatisPlusInjectorAutoConfiguration {

  @Bean
  @ConditionalOnMissingBean
  public MySqlInjector mysqlInjector() {
    return new MySqlInjector();
  }

}

